import { ApiPropertyOptional } from '@midwayjs/swagger'
import { Rule, RuleType } from '@midwayjs/validate'

import { PageDTO } from '@/dto'

/**
 *  查找登录日志分页传输对象
 */
export class FindLoginLogPageDTO
  extends PageDTO
  implements IFindLoginLogPageDTO
{
  @ApiPropertyOptional({ description: '用户账号' })
  @Rule(RuleType.string().empty(''))
  userName: string

  @ApiPropertyOptional({ description: '登录IP' })
  @Rule(RuleType.string().empty(''))
  loginIp: string

  @ApiPropertyOptional({ description: '登录IP' })
  @Rule(RuleType.string().empty(''))
  loginLocation: string

  @ApiPropertyOptional({ description: '开始时间' })
  @Rule(RuleType.date().empty(''))
  beginDate: Date

  @ApiPropertyOptional({ description: '开始时间' })
  @Rule(RuleType.date().empty(''))
  endDate: Date
}
